<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>商品评价</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta http-equiv="pragma" content="no-cache">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <script src="$!webPath/resources/style/app/goodsEvaluation/js/zepto.min.js"></script>
    <script src="$!webPath/resources/style/app/goodsEvaluation/js/iscroll.js"></script>
    <link href="$!webPath/resources/style/app/goodsEvaluation/css/resizeHtmlFont.css?version=2016010801" rel="stylesheet" type="text/css">
    <link href="$!webPath/resources/style/app/goodsEvaluation/css/style.css?version=2016010903" rel="stylesheet" type="text/css">
    <script src="$!webPath/resources/style/app/goodsEvaluation/js/dongsj.js"></script>
</head>
<body>
<div class="itemComments" style="background-color: #eeeeee;padding-top:0.3rem">
    <div class="lk">
        <div class="l1">
            <div class="left">
                商品评价
            </div>
            <div class="right">
                $!evaluations.totalCount
            </div>
        </div>
        <div class="l2">
            <div class="left">
                综合好评度
            </div>
            <div class="right">
                $!evaluations.goodPD
               	#if(0 != $!evaluations.totalCount)
                <div class="s2">
                    <div class="s1" style="width: $!evaluations.goodPD;"></div>
                </div>
                #end
            </div>
        </div>
    </div>
	
	
    <ul class="commentBlock">
	#foreach($evaluation in $evaluations.evaluataions)
		<li>
	            <header class="userBlock">
	                <div class="userHead">
	                	#if($!evaluation.avatar)
	                    <img src="$!evaluation.avatar.smallPicUrl">
	                    #else
	                    <img src="http://dfs.qingyung.cn:8090/group2/M00/05/A0/CqwC8FZf5hyABMRQAAAXSCpBl5Y587.png">
	                    #end
	                </div>
	                <div class="userInfo">
	                    <div class="userName">$!evaluation.userName</div>
	                    <div class="sBlock">
	                        <div class="s1" style="width: $!evaluation.gradePercent;"></div>
	                    </div>
	                </div>
	            </header>
	            <p class="c1">$!evaluation.content</p>
	            <div class="imgs">
	            #set($imgIdx=0)
	            #foreach($attachment in $evaluation.attachments)
	                <img src="$!attachment.smallImageUrl" onclick="clickPic(this, $imgIdx)">
	                <input type="hidden" value="$!attachment.imageUrl">
	                #set($imgIdx= $imgIdx + 1)
	            #end 
	            </div>
	            <time>$!evaluation.creatTime</time>
	            
	            #if($!{evaluation.evaluatereplys})
	            <div class="c2">
	            #foreach($evaluatereply in $evaluation.evaluatereplys)
	            	<p>
	                    <span> $!evaluatereply.erReplyuser：</span>$!evaluatereply.erContent
	                </p>
	            #end 
	            </div>
	            #end
		 </li>
    #end
    </ul>
</div>

<script type="text/javascript">
var url = "$!webPath/app/goods/evaluation.htm?goodsId=$!evaluations.goodsId&version=1.0";
$(".lk").bind("click",function(){
        $("body").append("<iframe src='"+ url +"' style='display:none'></iframe>");
    });
    
function clickPic(thisImg,idx){
	var imgs = $(thisImg).parent().children("input");
	var srcs = "";
	for(var i=0; i<imgs.length; i++){
		if(i == 0){
			srcs = encodeURIComponent(imgs[i].value);
		}else{
			srcs = srcs + ","+ encodeURIComponent(imgs[i].value);
		}
	}
	var url = "viewImgs?idx="+idx+"&srcs="+srcs;
	$("body").append("<iframe src='nativeapi://"+url+"' style='display:none'></iframe>");
}
</script>
</body>
</html>